let path = require('path');
let vars = path.resolve(__dirname, 'variable.less')

function resolve(dir) { return path.join(__dirname, dir) }
module.exports = {
	'chainWebpack': config => {
		// 配置别名
		config.resolve.alias.set('@', resolve('src')).set('src', resolve('src'));
	},
	// 确保静态资源
	'configureWebpack': config => {
		config.resolve.extensions = ['.js', '.jsx', '.vue', '.json', '.css', '.less', '.ts', '.tsx'];
	},
	css: {
		loaderOptions: {
			less: {
				globalVars: {
					"hack": `true; @import "${vars}"`
				}
			}
		}
	}
}
